﻿<?php
include ('includes/config.php');
include ('includes/functions.php');
include ('includes/front_functions.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta name="author" content="PNT" />
    <title>Đà Nẵng Buýt</title>
    <link rel="stylesheet" href="css/style.css" type="text/css"  />
	<script type='text/javascript' charset="utf-8" src='js/OpenLayers-2.12/OpenLayers.js'></script>
	<script type="text/javascript" charset="utf-8" src="js/map.js"></script>
	<script type="text/javascript" charset="utf-8" src="js/tiny_mce/tiny_mce.js"></script>
	<script type="text/javascript" charset="utf-8" src="js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/jquery-ui-1.7.2.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/jquery.validate.min.js"></script>
	<script type="text/javascript">
		var map;

		function init() {
			
			var bounds = new OpenLayers.Bounds(
				107.817883080344, 15.9140867740137,
				108.337590000029, 16.2251302357152
			);
			
			var options = {
				controls: [
					new OpenLayers.Control.Navigation(),
					new OpenLayers.Control.PanZoomBar(),
					new OpenLayers.Control.LayerSwitcher({'ascending': true}),
					new OpenLayers.Control.MousePosition(),
					new OpenLayers.Control.ScaleLine(),
					new OpenLayers.Control.OverviewMap()
				],
				numZoomLevels: 20,
				maxExtent: bounds,
				maxResolution:  0.0020301051550195,
				projection: "EPSG:4326",
				units: 'degrees'
			};
			map = new OpenLayers.Map('map-element', options);
					
			var layer_QuanHuyen = new OpenLayers.Layer.WMS(
				'Quan Huyen',
				'http://localhost:8080/geoserver/DATN/wms',
				{
					layers: 'DATN:DNQH',
					styles: '',
					transparent: 'true',
				},
				{
				   singleTile: true, 
				   ratio: 1,
				   isBaseLayer: true,
				   yx : {'EPSG:4326' : false}
				} 
			);
			map.addLayer(layer_QuanHuyen);
			
			var layer_GiaoThong = new OpenLayers.Layer.WMS(
				'Giao Thong',
				'http://localhost:8080/geoserver/DATN/wms',
				{
					layers: 'DATN:DNGT',
					styles: '',
					transparent: 'true',
				},
				{
				   singleTile: true, 
				   ratio: 1, 
				   yx : {'EPSG:4326' : false}
				} 
			);
			map.addLayer(layer_GiaoThong);
			
			var layer_TramDung = new OpenLayers.Layer.WMS(
				'Tram Dung',
				'http://localhost:8080/geoserver/DATN/wms',
				{
					layers: 'DATN:DNTramDung',
					styles: '',
					transparent: 'true',
				},
				{
				   singleTile: true, 
				   ratio: 1, 
				   yx : {'EPSG:4326' : false}
				} 
			);
			map.addLayer(layer_TramDung);
			
			var layer_TuyenXe = new OpenLayers.Layer.WMS(
				'Tuyen Xe',
				'http://localhost:8080/geoserver/DATN/wms',
				{
					layers: 'DATN:DNTuyenXe',
					styles: '',
					transparent: 'true',
				},
				{
				   singleTile: true, 
				   ratio: 1, 
				   yx : {'EPSG:4326' : false}
				} 
			);
			map.addLayer(layer_TuyenXe);
			
			// Zoom the map to the max extent 
			if(!map.getCenter()){
				map.zoomToMaxExtent();
			}
		}
		
    	tinyMCE.init({
    		mode : "textareas",
    		theme : "advanced",
    		plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave"
            
    	});
		
    </script>
</head>

<body onload="init()">
<div id="wrapper">
	<div id="header">
		<ul>
		</ul>
		<div id="logo"><img src="images/banner.jpg" /></div>
		<div id="main-nav">
			<ul>
				<li><a href="index.php#">Trang chủ</a></li>
				<li><a href="index.php?mod=news">Tin tức</a></li>
				<li><a href="index.php?mod=map">Bản đồ</a></li>
				<li><a href="index.php?mod=about">Giới thiệu</a></li>
				<li><a href="index.php?mod=contact">Liên Hệ</a></li>
			</ul>
		</div>
	</div><!-- end #header -->
	<div id="main-body">
			<div class="map-content">
				<h3 class='about-title'>Bản đồ hệ thống xe buýt thành phố Đà Nẵng</h3>
				<div id="map-element"></div>
			</div>
	</div><!-- end #main-body -->
	<div id="footer">
		Đà Nẵng Bus </br>
		Copyright © 2013 by PNT
	</div><!-- end #<!-- end #main-body -->
</div>

</body>
</html>